/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (C) 2017 Andes Technology Corporation
 * Copyright, 2024 Shandong Exponent Semiconductor CO., Ltd.            
 * Copyright, 2024 Sansec Technology CO., Ltd.                          
 *                     All Rights Reserved   
 *
 */
#ifndef _DCF_SBI_H_
#define _DCF_SBI_H_

#include <sbi/sbi_trap.h>
#include <sbi_utils/fdt/fdt_helper.h>

enum sbi_ext_dcf_fid {
	SBI_EXT_DCF_GET_MCCTL_STATUS = 0,
	SBI_EXT_DCF_GET_MMISC_CTL_STATUS,
	SBI_EXT_DCF_SET_MCCTL,
	SBI_EXT_DCF_SET_MMISC_CTL,
	SBI_EXT_DCF_ICACHE_OP,
	SBI_EXT_DCF_DCACHE_OP,
	SBI_EXT_DCF_L1CACHE_I_PREFETCH,
	SBI_EXT_DCF_L1CACHE_D_PREFETCH,
	SBI_EXT_DCF_NON_BLOCKING_LOAD_STORE,
	SBI_EXT_DCF_WRITE_MERGE,
	SBI_EXT_DCF_TRIGGER,
	SBI_EXT_DCF_SET_PFM,
	SBI_EXT_DCF_READ_POWERBRAKE,
	SBI_EXT_DCF_WRITE_POWERBRAKE,
	SBI_EXT_DCF_SUSPEND_PREPARE,
	SBI_EXT_DCF_SUSPEND_MEM,
	SBI_EXT_DCF_SET_SUSPEND_MODE,
	SBI_EXT_DCF_ENTER_SUSPEND_MODE,
	SBI_EXT_DCF_RESTART,
	SBI_EXT_DCF_RESET_VEC,
	SBI_EXT_DCF_SET_PMA,
	SBI_EXT_DCF_FREE_PMA,
	SBI_EXT_DCF_PROBE_PMA,
	SBI_EXT_DCF_DCACHE_WBINVAL_ALL,
	SBI_EXT_DCF_HPM,
};

int evalsoc_set_suspend_mode(u32 suspend_mode);
int evalsoc_enter_suspend_mode(bool main_core, unsigned int wake_mask);

int dcf_sbi_vendor_ext_provider(long extid, long funcid,
				  const struct sbi_trap_regs *regs,
				  unsigned long *out_value,
				  struct sbi_trap_info *out_trap,
				  const struct fdt_match *match);

#endif /* _DCF_SBI_H_ */
